package com.lingshu.app.ui.report;

import androidx.lifecycle.MutableLiveData;

import com.lingshu.app.base.BaseViewModel;
import com.lingshu.app.model.register.RegisterResponse;
import com.lingshu.app.model.register.RegisterScreenshotResponse;

public abstract class CommonViewModel extends BaseViewModel {
    protected String TAG = this.getClass().getName();
    protected RegisterResponse registerInfo;
    protected RegisterScreenshotResponse screenshotResponse1;
    protected RegisterScreenshotResponse screenshotResponse2;

    public MutableLiveData<Boolean> allowInputR = new MutableLiveData<>();
    public MutableLiveData<Boolean> allowInputL = new MutableLiveData<>();
    public MutableLiveData<Boolean> canSave = new MutableLiveData<>();
    public MutableLiveData<Boolean> canAudit = new MutableLiveData<>();
    public MutableLiveData<RegisterResponse> reportAuditResponse = new MutableLiveData<>();

    public MutableLiveData<Boolean> rightIsConfirm = new MutableLiveData<>();
    public MutableLiveData<Boolean> leftIsConfirm = new MutableLiveData<>();
    public MutableLiveData<Boolean> allSingleReport = new MutableLiveData<>();

    protected void initLiveData() {
        if (allowInputR.getValue() == null) {
            allowInputR.postValue(false);
        }
        if (allowInputL.getValue() == null) {
            allowInputL.postValue(false);
        }
        if (canSave.getValue() == null) {
            canSave.postValue(true);
        }
        if (canAudit.getValue() == null) {
            canAudit.postValue(false);
        }
        if (allSingleReport.getValue() == null) allSingleReport.postValue(false);
        if (rightIsConfirm.getValue() == null) rightIsConfirm.postValue(false);
        if (leftIsConfirm.getValue() == null) leftIsConfirm.postValue(false);
    }

    public void saveReport() {
        infoMsg.postValue("开发中");
    }

    public void auditReport() {
        infoMsg.postValue("开发中");
    }
}
